Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
unist-util-generated
Advanced tools
Readme
unist utility to check if a node is generated.
This utility can be used to check if a node is said to be generated.
You can use this utility to check is generated. Generated nodes were not in the source of the original file, and thus not authored by a human. This info can then be used to not emit lint messages for generated content.
You might also find the utility unist-util-position
useful to get clean positional info.
To display positional info to users, use
unist-util-stringify-position
.
This package is ESM only. In Node.js (version 14.14+ and 16.0+), install with npm:
npm install unist-util-generated
In Deno with esm.sh
:
import {generated} from 'https://esm.sh/unist-util-generated@2'
In browsers with esm.sh
:
<script type="module">
import {generated} from 'https://esm.sh/unist-util-generated@2?bundle'
</script>
import {generated} from 'unist-util-generated'
generated({}) // => true
generated({position: {start: {}, end: {}}}) // => true
generated({
position: {start: {line: 1, column: 1}, end: {line: 1, column: 2}}
}) // => false
This package exports the identifier generated
.
There is no default export.
generated(node)
Check if node
is generated.
node
(Node
)
— node to checkWhether node
is generated (does not have positional info) (boolean
).
This package is fully typed with TypeScript. It exports no additional types.
Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. Our projects sometimes work with older versions, but this is not guaranteed.
unist-util-position
— get the position of nodesunist-util-source
— get the source of a node or positionunist-util-remove-position
— remove position
sunist-util-stringify-position
— serialize positional infoSee contributing.md
in syntax-tree/.github
for
ways to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
unist utility to check if a node is generated
We found that unist-util-generated demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).